<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><{:C('site_name')}></title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" href="<{:STATICS}>/css/bootstrap.min.css" type="text/css" media="all" />
<link rel="stylesheet" href="<{:RES}>/css/admin.css" type="text/css"/>
</head>
<script type="text/javascript" src="<{:STATICS}>/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/jquery.artDialog.js?skin=aero"></script>
<script type="text/javascript" src="<{:STATICS}>/js/iframeTools.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/jquery.form.min.js"></script>
<script type="text/javascript" src="<{:STATICS}>/js/jquery.validate.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	//ajaxform
	var options = { 
		beforeSubmit:showRequest,//表单验证方式
        success:showResponse  // post-submit callback 
    }; 

    $('#ajaxForm').ajaxForm(options); 

    function showResponse(responseText, statusText)  {

		if (statusText == 'success') {
			var responseText=eval('('+responseText+')');
			if(responseText.state != 'SUCCESS'){
				responseText.message = responseText.state;
			}
			returnHomepage(responseText.state , responseText.message , responseText.url);
		}else{
			alert('Server error');
		}
	} 

	function showRequest(){
		 return $("form.form-validata").valid();
	}

	//validation验证
	$("form.form-validata").validate({
		errorElement: "span",
        errorClass: "help-inline error",
	})

}); 

// 返回数据到主页面
function returnHomepage(stats , msgContent , url){

	if(stats == 'SUCCESS'){
		var origin = artDialog.open.origin;
		var domid=art.dialog.data('domid');
		origin.document.getElementById(domid).innerHTML = url;
		alert('<{:L('_action_success')}>');
		setTimeout("art.dialog.close()");		
	}else{
		alert(msgContent);
	}
}
</script>
<body>

<div class="container">
	<div class="row">
		<div class="col-sm-12">
			<form id="ajaxForm" action="<{:U('Node/update')}>" method="post" class="form-horizontal form-validata">
				<php>if($list['pid']>0){</php>
				<div class="form-group">
					<label class="col-xs-2 control-label" for="title">Parent node</label>
					<div class="col-xs-8">
						<div class="form-control-static"><strong style="color:#000;"><{$pname}></strong></div>
					</div>
				</div>
				<php>}</php>
					
				<div class="form-group">
					<label class="col-xs-2 control-label" for="name"><{$nodeName}> Name</label>
					<div class="col-xs-8">
						<input type="text"
						class="form-control"
						name="name"
						id="name"
						data-rule-required="true"
						value="<{$list['name']}>" 
						/>
					</div>
				</div>	

				<div class="form-group">
					<label class="col-xs-2 control-label">Descriptions</label>
					<div class="col-xs-8">
						<input type="text"
						class="form-control"
						name="title"
						id="title"
						value="<{$list['title']}>" 
						data-rule-required="true"
						/>
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-2 control-label" for="status">Status</label>
					<div class="col-xs-8">
						<label class="radio-inline">
						<input name="status" type="radio" value="0" <php>if($list['status']==='0')echo checked;</php>/>close	
						</label>
						<label class="radio-inline">		
						<input name="status" type="radio" value="1" <php>if($list['status']==='1')echo checked;</php>/>open
						</label>
					</div>
				</div>		
				<div class="form-group">
					<label class="col-xs-2 control-label" for="remark">Remark</label>
					<div class="col-xs-8">
						<input type="text"
						class="form-control"
						name="remark"
						id="remark"
						value="<{$list['remark']}>" 
						/>
					</div>
				</div>	
				<div class="form-group">
					<label class="col-xs-2 control-label" for="sort">Sort</label>
					<div class="col-xs-8">
						<input type="text"
						class="form-control"
						name="sort"
						id="sort"
						value="<{$list['sort']}>" 
						data-rule-required="true"
						/>
					</div>
				</div>	
				<div class="form-group">
					<div class="col-xs-10 col-xs-offset-2">
						<button type="submit" class="btn btn-info btn-sm"><i class="icon-plus-sign icon-white"></i>  <{:L('_public_edit')}> <{$nodeName}></button>
					</div>
				</div>
				<input type="hidden" name="pid" value="<{$list['pid']}>" />
				<input type="hidden" name="level" value="<{$list['level']}>" />
				<input type="hidden" name="id" value="<{$list['id']}>" />
			</form>
		</div>
	</div>
</div>

</body>
</html>